//
//  LyjViewController.m
//  StarRating
//
//  Created by li3299838665 on 06/07/2017.
//  Copyright (c) 2017 li3299838665. All rights reserved.
//

#import "LyjViewController.h"
#import <StarRating/StarRating-umbrella.h>



@interface LyjViewController ()

@property (weak, nonatomic) IBOutlet StarEvaluatorView *star1;


@property (weak, nonatomic) IBOutlet UILabel *valueLabel;


@end

@implementation LyjViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    
    self.star1.currentValue = 3;
}

- (void)viewDidLayoutSubviews {
    
//    self.star1.currentValue = 5;
//    self.star1.userInteractionEnabled = NO;
    
    self.star1.isAllowedSliding = YES;
    
    self.star1.horizontalSpacing = 40;
    
//    self.star1.highlightImage = [UIImage imageNamed:@"star2.png"];
//    self.star1.unHightlightImage = [UIImage imageNamed:@"star1.png"];
    
    self.star1.aspectRatio = 1;
    
    self.star1.starNum = 4;
    
    self.star1.currentValueBlock = ^(CGFloat currentValue) {
        
        dispatch_async(dispatch_get_main_queue(), ^{
            
            self.valueLabel.text = [NSString stringWithFormat:@"%.2f" , currentValue];
        });
    };
}



- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
